package com.turing.post.capitalaccounts.util;

import java.math.BigInteger;
import java.util.List;

import javax.ejb.Local;
import javax.ejb.Remote;

import com.turing.post.util.PCPSApplicationException;
import com.turing.post.util.PCPSWebInput;

/**
 * 销售机构上存/缴现金支出单数据访问接口
 * 
 * @author zxp 6, 2013
 */
@Remote
@Local
public interface SaleCashWithdrawBillDao {

	/**
	 * 根据主键查询
	 * 
	 * @param drawBillId
	 *            主键ID
	 * @return 销售机构上存/缴现金支出单
	 */
	public SaleCashWithdrawBill getSaleCashWithdrawBillById(
			BigInteger drawBillId);

	/**
	 * 列表
	 * 
	 * @param saleBranchNo
	 *            归属机构号
	 * @param page
	 *            页数
	 * @return 销售机构上存/缴现金支出单列表
	 */
	public List<SaleCashWithdrawBill> getSaleCashWithdrawBillList(
			PCPSWebInput webInput, String startTranDate, String endTranDate,
			BigInteger startAmount, BigInteger endAmount, String saleBranchNo,
			Integer page);

	/**
	 * 记录数
	 * 
	 * @param saleBranchNo
	 *            所属机构号
	 * @return 记录数
	 */
	public BigInteger getSaleCashWithdrawBillTotal(PCPSWebInput webInput,
			String startTranDate, String endTranDate, BigInteger startAmount,
			BigInteger endAmount, String saleBranchNo);

	/**
	 * 新增销售机构上存/缴现金支出单
	 * 
	 * @param saleCashWithdrawBill
	 *            销售机构上存 /缴现金支出单
	 * @throws PCPSApplicationException
	 */
	public void insertSaleCashWithdrawBill(
			SaleCashWithdrawBill saleCashWithdrawBill)
			throws PCPSApplicationException;

	/**
	 * 修改销售机构上存/缴现金支出单
	 * 
	 * @param saleCashWithdrawBill
	 *            销售机构上存 /缴现金支出单
	 * @throws PCPSApplicationException
	 */
	public void updateSaleCashWithdrawBill(
			SaleCashWithdrawBill saleCashWithdrawBill)
			throws PCPSApplicationException;

	public SaleCashWithdrawBill getSaleCashWithdrawBillByVoucherNo(
			String voucherNo);

	/**
	 * 检查凭证号是否已经使用
	 * 
	 * @param issueCompanyNo
	 * @param voucherNo
	 * @return
	 */
	public Integer checkSaleCashWithdrawBillVoucherNo(String issueCompanyNo,
			String voucherNo);
}